﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

public class SunflowerStar : EventTrigger
{
    private int starScore = 50;

    public override void OnPointerClick(PointerEventData eventData)
    {
        //点击阳光
        Text monoyText = GameObject.Find("Money").transform.Find("Text").GetComponent<Text>();
        //获取现在的金币数
        int monoyCount = int.Parse(monoyText.text);
        //显示出来
        monoyText.text = (monoyCount + starScore).ToString();

        Destroy(this.gameObject);
    }

}
